<template>
  <div class="not-found">
    <!-- 视觉区 -->
    <div class="error-content">
      <div class="graphic">
        <img src="@/assets/svg/404.svg" alt="404 Illustration">
      </div>
      <div class="text">
        <h1>404</h1>
        <p>您访问的页面不存在或已失效</p>
        <el-button type="primary" @click="goHome" class="home-btn">
          返回首页
        </el-button>
      </div>
    </div>

    <!-- 辅助导航 -->
    <!-- <div class="secondary-actions">
      <router-link to="/help">帮助中心</router-link>
      <router-link to="/contact">联系我们</router-link>
    </div> -->
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push('/'); // 返回首页
};
</script>

<style scoped>
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f2 100%);
  padding: 2rem;
}

.error-content {
  display: flex;
  max-width: 900px;
  gap: 3rem;
  align-items: center;
}

.graphic img {
  width: 100%;
  max-width: 400px;
}

.text {
  text-align: center;
}

.text h1 {
  font-size: 6rem;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.text p {
  font-size: 1.5rem;
  color: #7f8c8d;
  margin-bottom: 2rem;
}

.home-btn {
  padding: 12px 32px;
  font-size: 1.1rem;
}

.secondary-actions {
  margin-top: 3rem;
  display: flex;
  gap: 2rem;
}

.secondary-actions a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.secondary-actions a:hover {
  text-decoration: underline;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .error-content {
    flex-direction: column;
  }

  .text h1 {
    font-size: 4rem;
  }
}
</style>
